<!--商户酒币记录-->
<div class="search">
  <nz-select style="width:100px;" [(ngModel)]="auditstatus" nzAllowClear nzPlaceHolder="审核状态" (ngModelChange)="searchData()">
    <nz-option *ngFor="let item of statuslist" [nzValue]="item.key" [nzLabel]="item.value"></nz-option>
  </nz-select>
  <nz-select style="width:100px;" [(ngModel)]="sendstatus" nzAllowClear nzPlaceHolder="补货状态" (ngModelChange)="searchData()">
    <nz-option *ngFor="let item of statuslist2" [nzValue]="item.key" [nzLabel]="item.value"></nz-option>
  </nz-select>
  添加日期:
  <nz-date-picker nzFormat="yyyy-MM-dd" [(ngModel)]="sdate" nzPlaceHolder="开始日期">
  </nz-date-picker>
  ~
  <nz-date-picker nzFormat="yyyy-MM-dd" [(ngModel)]="edate" nzPlaceHolder="结束日期">
  </nz-date-picker>
  <nz-input-group nzSuffixIcon="anticon anticon-search" style="width:10%;margin-left:1rem;">
    <input type="text" nz-input placeholder="输入餐厅名称查询" [(ngModel)]="name" (keyup.enter)="searchData()">
  </nz-input-group>
  <a (click)="searchData()">查询</a>
</div>

<nz-table #ajaxTable nzShowSizeChanger [nzFrontPagination]="false" [nzData]="dataSet" [nzLoading]="loading" [nzTotal]="total"
  [nzShowTotal]="totalTemplate" [(nzPageIndex)]="pageIndex" [(nzPageSize)]="pageSize" (nzPageIndexChange)="searchData()"
  (nzPageSizeChange)="searchData(true)" [nzScroll]="{ x:'1000px',y: '400px' }">
  <thead>
    <tr>
      <th nzWidth="60px" nzLeft="0px">序号</th>
      <th nzWidth="200px">商户名称</th>
      <th nzWidth="100px">补货总数量</th>
      <th nzWidth="100px">审核状态</th>
      <th nzWidth="100px">补货状态</th>
      <th nzWidth="160px">添加日期</th>
      <!-- <th nzWidth="200px">数量</th> -->
      <th nzWidth="160px" nzRight="0px">操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of ajaxTable.data;index as i">
      <td nzLeft="0px">{{i+1}}</td>
      <!-- <td>  <img *ngIf="data.img" [src]="data.img" class="avatar" style="width: 50px; height:50px;"></td> -->
      <td>{{data.merchantname}}</td>
      <td>{{data.totalcount}}</td>
      <td>{{data.AuditStatus}}</td>
      <td>{{data.SendStatus}}</td>
      <td>{{data.createTime | date:"yyyy-MM-dd HH:mm"}}</td>
      <!-- <td>{{data.count}}</td> -->
      <td nzRight="0px">
        <a (click)="see(data._id)">查看详情</a>
        <a *ngIf="data.AuditStatus=='未审核'" (click)="auditpass(data._id)">通过</a>
        <a *ngIf="data.AuditStatus=='未审核'" (click)="auditrefuse(data._id)">拒绝</a>
        <a *ngIf="data.AuditStatus=='已审核'&&data.SendStatus=='未配送'" (click)="Sendpass(data._id)">补货</a>
        <a *ngIf="data.SendStatus=='已配送'&&data.AuditStatus=='已审核'">已补货</a>
      </td>
    </tr>
  </tbody>
</nz-table>

<ng-template #totalTemplate let-total>
  共 {{total}} 条
</ng-template>


<nz-modal [(nzVisible)]="isVisible" nzTitle="配送详情" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" nzWrapClassName="vertical-center-modal"
  [nzMaskClosable]="false" nzWidth="800">
  <div style="margin-bottom: 16px;">
    <div>
      <p><span>配送明细</span></p>
      <table *ngIf="winelist">
        <thead>
          <tr>
            <th>图片</th>
            <th nzWidth="60px">名称</th>
            <th>申请配送数量</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let item of winelist;index as i">
            <td><img *ngIf="item.img" [src]="item.img" class="avatar" style="width: 20px; height:20px;"></td>
            <td><input type="text" nz-input [(ngModel)]="item.name" disabled="true"></td>
            <td><input type="text" nz-input [(ngModel)]="item.count" disabled="true"></td>

            <!-- <td>
              <nz-select style="width:100px;margin-right: 5px;" [(ngModel)]="item.win" nzPlaceHolder="是否中奖">
                <nz-option *ngFor="let a of winlist" [nzValue]="a.key" [nzLabel]="a.value"></nz-option>
              </nz-select>
            </td> -->
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</nz-modal>